package com.saturn.action.sldb.reconciliation;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.saturn.app.utils.BeanUtils;
import com.saturn.app.web.IAction;
import com.saturn.app.web.IView;
import com.saturn.app.web.view.JspErrorView;
import com.saturn.app.web.view.JspView;
import com.saturn.sldb.Reconciliation;

public class UpdateReconciliationAction implements IAction{
	@Override
	public IView execute(HttpServletRequest request,
			HttpServletResponse response) {
		Reconciliation vo = BeanUtils.getBean(request, Reconciliation.class);
		String type = request.getParameter("type");
		
		if("一事一议".equals(type)){
			if (Reconciliation.edit(vo) == 1) {
				return new JspView("/app/sldb/total/discussion/show.jsp");
			} else {
				return new JspErrorView("更新信息失败");
			}
		}else{
			if (Reconciliation.edit(vo) == 1) {
				return new JspView("/app/sldb/total/tmp/show.jsp");
			} else {
				return new JspErrorView("更新信息失败");
			}
		}
		
	}
	@Override
	public String requestMapping() {
		return "/app/sldb/reconciliation/updateReconciliation.action";
	}
}
